<!-- pulse line -->
<template>
  <el-amap-loca-pulse-line
    :initEvents="false"
    v-for="(pulseLineComponentItem, index) in pulseLineLayoutComponents"
    :key="pulseLineComponentItem.componentId"
    :visible="pulseLineComponentItem.visible"
    :opacity="pulseLineComponentItem.opacity"
    :source-data="pulseLineComponentItem.sourceData"
    :layer-style="pulseLineComponentItem.layerStyle"
    :zIndex="pulseLineComponentItem.zIndex"
    :visible-duration="500"
    :ref="`pulseLineLayoutComponents${index}`"
    @click="clickPulseLine"
  />
</template>

<script>
export default {
  emits: ['clickPulseLine'],
  props: ['pulseLineLayoutComponents'],
  methods: {
    clickPulseLine(feature, event) {
      feature ? this.$emit('clickPulseLine', { feature, event }) : '';
    },
    getpulseLineLayoutComponentsRef(index) {
      return this.$refs[`pulseLineLayoutComponents${index}`];
    },
  },
};
</script>
<style lang="less" scoped></style>
